package Tests;

import static org.junit.Assert.*;

import org.junit.Test;

import Abilities.Ability;

public class AnAbilityShould {

	@Test
	public void beCreatedWithANameWhenConstructed() {
		Ability ability = new Ability("Art of War");
		assertEquals("Art of War", ability.getName());
		ability = null;
	}

	@Test
	public void beCreatedWithANameAndAmountWhenConstructed() {
		Ability ability = new Ability("Art of War", 220);
		assertEquals("Art of War", ability.getName());
		assertEquals(220, ability.getTotalAmount());
		assertEquals(220, ability.getMaxHit());
		ability = null;
	}

	@Test
	public void updateTheMaxHitWhenRequested() {
		Ability ability = new Ability("Art of War", 220);
		ability.setTotalAmount(300);
		assertEquals("Art of War", ability.getName());
		assertEquals(520, ability.getTotalAmount());
		assertEquals(300, ability.getMaxHit());
		ability = null;
	}

	@Test
	public void returnNameAmountAndMaxHitWhenToStringIsCalled() {
		Ability ability = new Ability("Art of War", 220);
		ability.setTotalAmount(300);
		
		String result = ability.toString();
		assertTrue(result.contains("Ability: Art of War 520 300"));
	}
}

